<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class feedback extends CI_Controller {

    public function __construct() {
        parent::__construct();
        session_start();
    }

    public function index() {
        $subject = "Feedback - " . $_SESSION['establecimiento']['nombre'];
        $body = "Nombre: {$_POST["nombre"]}\n\nMensaje: {$_POST["mensaje"]}";
        $headers = 'From: Optilodging@innovationtur.com' . "\r\n" .
                'X-Mailer: PHP/' . phpversion();
        mail("gerencia@innovationtur.com", $subject, $body, $headers);

        mail("luismec90@gmail.com", $subject, $body, $headers);
        echo "ok";
    }

}
